Skip to main content

Gradient

Gradient: Definition

The gradient of a scalar-valued function f:RnRf: \mathbb{R}^n \rightarrow \mathbb{R} is a vector-valued function f:RnRn\nabla f: \mathbb{R}^n \rightarrow \mathbb{R}^n that stores all the partial derivatives of ff with respect to each variable. Formally,

f(x)=[fx1,fx2,,fxn]T\nabla f(\mathbf{x}) = \left[ \frac{\partial f}{\partial x_1}, \frac{\partial f}{\partial x_2}, \ldots, \frac{\partial f}{\partial x_n} \right]^T

Here x=[x1,x2,,xn]T\mathbf{x} = [x_1, x_2, \ldots, x_n]^T is a point in Rn\mathbb{R}^n.

Gradient as a Vector Map

The gradient at each point x\mathbf{x} can be viewed as a vector pointing in the direction of the steepest ascent of the function ff at x\mathbf{x}. This means that if you move from x\mathbf{x} to x+δx\mathbf{x} + \delta \mathbf{x} along the direction of f(x)\nabla f(\mathbf{x}), you will achieve the maximum rate of increase for the function ff.

Gradient Mapping for (x,y)(x,y)

For a function f(x,y)f(x, y), the gradient f(x,y)\nabla f(x, y) would be a 2D vector [fx,fy][f_x, f_y], where fx=fxf_x = \frac{\partial f}{\partial x} and fy=fyf_y = \frac{\partial f}{\partial y}.

In the context of a vector map, each point (x,y)(x, y) on the Cartesian coordinate system would map to a vector pointing in the direction of f(x,y)\nabla f(x, y). If you were to draw these vectors as arrows originating from their corresponding (x,y)(x,y) points, you would get a "vector field" that visually represents the gradient across the domain.

Figures to add later...

A figure illustrating this concept could be a 2D contour plot of f(x,y)f(x, y) overlaid with arrows representing f(x,y)\nabla f(x, y) at various points (x,y)(x, y). Each arrow would point in the direction of the steepest ascent of ff at its originating point. The length of the arrow would be proportional to the magnitude of f(x,y)\nabla f(x, y), providing a visual cue for the rate of change at each point.